package com.abel.bigwater.tlv.model

import io.netty.buffer.ByteBuf

/**
 * tag = 1, 2, 3, 4, 6:
 * tag, length, (id, value)+
 * tag = 5:
 * tag, result.
 */
interface TlvDataApi {
    @Throws(TlvNotEnoughByteException::class, TlvUnkownTagException::class)
    fun finalLen(): Int

    @Throws(TlvNotEnoughByteException::class, TlvUnkownTagException::class)
    fun fill(buf: ByteBuf): ByteBuf

    @Throws(TlvNotEnoughByteException::class, TlvUnkownTagException::class, TlvInvalidException::class)
    fun parse(buf: ByteBuf): ByteBuf
}